<!DOCTYPE html>
<html>
<head>
<title>InnoDB free: 233472 kB</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta
	content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
	name="viewport">
<link rel="stylesheet" href="../../static/css/bootstrap.min.css">
<link rel="stylesheet" href="../../static/css/font-awesome.min.css">
<link rel="stylesheet"
	href="../../static/plugins/jqgrid/ui.jqgrid-bootstrap.css">
<link rel="stylesheet"
	href="../../static/plugins/ztree/css/metroStyle/metroStyle.css">
<link rel="stylesheet" href="../../static/css/main.css">
<script src="../../static/libs/jquery.min.js"></script>
<script src="../../static/plugins/layer/layer.js"></script>
<script src="../../static/libs/bootstrap.min.js"></script>
<script src="../../static/libs/vue.min.js"></script>
<script src="../../static/plugins/jqgrid/grid.locale-cn.js"></script>
<script src="../../static/plugins/jqgrid/jquery.jqGrid.min.js"></script>
<script src="../../static/plugins/ztree/jquery.ztree.all.min.js"></script>
<script src="../../static/js/common.js"></script>
</head>
<body>
	<div id="rrapp" v-cloak>
		<div v-show="showList">
			<div class="grid-btn form-inline">
				<a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
				<a class="btn btn-primary" @click="update"><i
					class="fa fa-pencil-square-o"></i>&nbsp;修改</a> <a
					class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>

				<div class="pull-right">
					<div class="form-group">
						<input type="text" class="form-control" v-model="q.dName"
							@keyup.enter="query" placeholder="医生姓名">
					</div>
					<a class="btn btn-primary " @click="query">查询</a>
				</div>

			</div>

			<table id="jqGrid"></table>
			<div id="jqGridPager"></div>
		</div>

		<div v-show="!showList" class="panel panel-default">
			<div class="panel-heading">{{title}}</div>
			<div class="panel-body">
				<form class="form-horizontal">
					<div class="form-group">
						<label>姓名</label> <input type="text" class="form-control"
							v-model="doctorinfo.dname" name="dname" placeholder="姓名" v-bind:disabled="showUpdate"/>
					</div>
					<div class="form-group" v-show="!showUpdate">
						<label>性别</label> <input type="radio" id="personSex1" value="1"
							name="dsex" v-bind:checked='radio_checked_personSex' v-bind:disabled="showUpdate"> <label
							for="personSex1">男</label> <input type="radio" id="personSex0"
							value="0" name="dsex" v-bind:checked='!radio_checked_personSex' v-bind:disabled="showUpdate">
						<label for="personSex0">女</label>
					</div>
					<div class="form-group">
						<label>所属科室</label> <select name="department" class="form-control">
							<template v-for="option in departmentOptions">
							<option :value="option.value"
								v-if="option.value == doctorinfo.department" selected>{{
								option.text }}</option>
							<option :value="option.value" v-else>{{ option.text }}</option>
							</template>
						</select>
					</div>
					<div class="form-group" v-show="showUpdate">
						<label>职务级别</label> <input readonly="readonly" type="text" class="form-control"
							v-model="doctorinfo.position" placeholder="职务级别" />
					</div>
					<div class="form-group" v-show="!showUpdate">
						<label>职务级别</label> <select name="position" class="form-control">
							<template v-for="option in positionOptions">
							<option :value="option.value"
								v-if="option.value === doctorinfo.position" selected>{{
								option.text }}</option>
							<option :value="option.value" v-else>{{ option.text }}</option>
							</template>
						</select>
					</div>
					<div class="form-group">
						<label>联系方式</label> <input type="text" class="form-control"
							v-model="doctorinfo.phone" name="phone" placeholder="联系方式" />
					</div>
					<div class="form-group">
						<div class="col-sm-2 control-label"></div>
						<input type="button" class="btn btn-primary" @click="saveOrUpdate"
							value="确定" /> &nbsp;&nbsp;<input type="button"
							class="btn btn-warning" @click="reload" value="返回" />
					</div>
				</form>
			</div>
		</div>
	</div>

	<script src="../../static/js/modules/doctorinfo.js"></script>
	<script type="text/javascript">
		//性别
		$("input[type='radio']").change(function() {
			vm.radio_checked = !vm.radio_checked;
			vm.doctorinfo.dsex = $(this).val();
		});
		//所属科室
		$("select[name='department']").change(function() {
			vm.doctorinfo.department = $(this).val();
			//调整科室对应职务级别
			if ($(this).val() === "五官科") {
				vm.positionOptions = vm.wgk_Options;
				vm.doctorinfo.position=vm.wgk_Options[0].value;
			}

			if ($(this).val() === "外科") {
				vm.positionOptions = vm.wk_Options;
				vm.doctorinfo.position=vm.wk_Options[0].value;
			}
			if ($(this).val() === "内科") {
				vm.positionOptions = vm.nk_Options;
				vm.doctorinfo.position=vm.nk_Options[0].value;
			}

		});
		//职务级别
		$("select[name='position']").change(function() {
			vm.doctorinfo.position = $(this).val();
		});
	</script>
</body>
</html>